using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TopographicProductionTools._DataManagement._Generalization
{
    /// <summary>
    /// <para>Thin Hydrology Lines</para>
    /// <para>Generates a simplified hydrographic line network for display at a smaller scale. The resulting hydrographic network maintains the main arteries while thinning less significant features based on hierarchy, length, and spacing between features.</para>
    /// <para>生成简化的水文线网络，以便以较小的比例显示。生成的水文网络可维护主动脉，同时根据要素之间的层次结构、长度和间距对不太重要的要素进行变薄。</para>
    /// </summary>    
    [DisplayName("Thin Hydrology Lines")]
    public class ThinHydrologyLines : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ThinHydrologyLines()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The hydrography line feature to be thinned.</para>
        /// <para>要变薄的水文线要素。</para>
        /// </param>
        /// <param name="_invisibility_field">
        /// <para>Invisibility Field</para>
        /// <para>Features that participate in the thinned hydrography collection will have a value of 0. Those that are extraneous have a value of 1. A layer definition query can be used to display the results.</para>
        /// <para>参与细化水文采集的要素的值将为 0。那些无关紧要的值为 1。图层定义查询可用于显示结果。</para>
        /// </param>
        /// <param name="_min_length">
        /// <para>Minimum Length</para>
        /// <para>An indication of the shortest hydrographic segment that is sensible to display at the output scale. It defines a sense of the resolution or granularity of the resulting thinned hydrography. It should correspond to a length that is visually significant to include at the final scale. The results of this tool are a balanced compromise between the requirements posed by hierarchy, minimum length, minimum spacing, angle of connecting features, and directionality of the hydro geometry. Therefore, the minimum length value cannot necessarily be measured directly in the resulting feature set.</para>
        /// <para>在输出比例下显示的最短水文段的指示。它定义了由此产生的稀疏水文的分辨率或粒度。它应该对应于在最终比例中包含的具有视觉意义的长度。该工具的结果是在层次结构、最小长度、最小间距、连接要素角度和流体几何图形的方向性所提出的要求之间实现了平衡的折衷。因此，最小长度值不一定直接在生成的特征集中测量。</para>
        /// </param>
        public ThinHydrologyLines(object _in_features, object _invisibility_field, string? _min_length)
        {
            this._in_features = _in_features;
            this._invisibility_field = _invisibility_field;
            this._min_length = _min_length;
        }
        public override string ToolboxName => "Topographic Production Tools";

        public override string ToolName => "Thin Hydrology Lines";

        public override string CallName => "topographic.ThinHydrologyLines";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_features, _invisibility_field, _min_length, _min_spacing, _hierarchy_field, _intersecting_features, _unsplit_lines.GetGPValue(), _use_angles.GetGPValue(), _updated_features];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The hydrography line feature to be thinned.</para>
        /// <para>要变薄的水文线要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Invisibility Field</para>
        /// <para>Features that participate in the thinned hydrography collection will have a value of 0. Those that are extraneous have a value of 1. A layer definition query can be used to display the results.</para>
        /// <para>参与细化水文采集的要素的值将为 0。那些无关紧要的值为 1。图层定义查询可用于显示结果。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Invisibility Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _invisibility_field { get; set; }


        /// <summary>
        /// <para>Minimum Length</para>
        /// <para>An indication of the shortest hydrographic segment that is sensible to display at the output scale. It defines a sense of the resolution or granularity of the resulting thinned hydrography. It should correspond to a length that is visually significant to include at the final scale. The results of this tool are a balanced compromise between the requirements posed by hierarchy, minimum length, minimum spacing, angle of connecting features, and directionality of the hydro geometry. Therefore, the minimum length value cannot necessarily be measured directly in the resulting feature set.</para>
        /// <para>在输出比例下显示的最短水文段的指示。它定义了由此产生的稀疏水文的分辨率或粒度。它应该对应于在最终比例中包含的具有视觉意义的长度。该工具的结果是在层次结构、最小长度、最小间距、连接要素角度和流体几何图形的方向性所提出的要求之间实现了平衡的折衷。因此，最小长度值不一定直接在生成的特征集中测量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Length")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _min_length { get; set; }


        /// <summary>
        /// <para>Minimum Spacing</para>
        /// <para>An indication of the shortest distance between a hydrographic segment that is sensible to display at the output scale. If the spacing between two parallel trending features is smaller than this value, one of the features will be set as invisible. It defines a sense of the density of the resulting thinned hydrography. It should correspond to the distance between two parallel trending features that is visually significant to include at the final scale. When the density of features is too high (that is, the features are too closely spaced), at least one feature will be hidden. This can result in important features or features longer than the Minimum Length being hidden.</para>
        /// <para>在输出比例下显示的可感知的水文线段之间的最短距离的指示。如果两个平行趋势要素之间的间距小于此值，则其中一个要素将被设置为不可见。它定义了由此产生的稀疏水文的密度感。它应对应于两个平行趋势要素之间的距离，该距离在最终比例中具有视觉意义。当要素密度过高（即要素间距太近）时，至少会隐藏一个要素。这可能会导致隐藏重要特征或长于最小长度的特征。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Spacing")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _min_spacing { get; set; } = null;


        /// <summary>
        /// <para>Hierarchy Field</para>
        /// <para>This field contains the hierarchical ranking of feature importance, where 1 is very important, and larger integers reflect decreasing importance. A value of 0 forces the feature to remain visible in the final results. It identifies the relative importance of features to help establish which features are significant. For optimal results, use no more than five levels of hierarchy. Input features with Hierarchy = 0 are considered locked and will remain visible, along with adjacent features necessary for connectivity.</para>
        /// <para>此字段包含要素重要性的分层排名，其中 1 非常重要，较大的整数表示重要性递减。值为 0 时，该要素在最终结果中保持可见。它标识了要素的相对重要性，以帮助确定哪些要素是重要的。为获得最佳效果，请使用不超过五个级别的层次结构。Hierarchy = 0 的输入要素被视为锁定，并将保持可见，以及连接所需的相邻要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Hierarchy Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _hierarchy_field { get; set; } = null;


        /// <summary>
        /// <para>Intersecting Features</para>
        /// <para>If a segment is snapped to features in the provided layers, it will not be removed. An example would be a small river segment snapped to a lake. Even if the segment is under the Minimum Length, it would need to remain to ensure that it remains connected to the water body into which it flows.</para>
        /// <para>如果将线段捕捉到所提供图层中的要素，则不会将其移除。一个例子是捕捉到湖泊的一小段河流。即使该段低于最小长度，也需要保持以保持与流入的水体的连接。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Intersecting Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _intersecting_features { get; set; } = null;


        /// <summary>
        /// <para>Unsplit Lines</para>
        /// <para><xdoc>
        ///   <para>This will merge any split features in the Input Features to help ensure that the main waterway is preserved. If unchecked, the ends of the waterway may be removed due to them being under the Minimum Length.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Features that are closed on both end points will be merged before thinning to preserve main hydrographic arteries that traverse a long distance. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Features will remain split before the thinning process.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>这将合并输入要素中的所有分割要素，以帮助确保保留主航道。如果不检查，水道的末端可能会因为它们低于最小长度而被移除。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 在变薄之前，将在两个端点上闭合的要素合并，以保留穿越长距离的主水文动脉。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 在细化过程之前，要素将保持分割状态。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Unsplit Lines")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _unsplit_lines_value _unsplit_lines { get; set; } = _unsplit_lines_value._true;

        public enum _unsplit_lines_value
        {
            /// <summary>
            /// <para>UNSPLIT_LINES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("UNSPLIT_LINES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_UNSPLIT_LINES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_UNSPLIT_LINES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Use intersection angles to determine main waterway</para>
        /// <para><xdoc>
        ///   <para>If checked, the angles between waterway branches will be used to help determine the main waterway; the highest angle will be used. If unchecked, the longest branch will be considered part of the main waterway.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—In junctions with 3 or more waterways, features that are closer together in angle will be kept.</bullet_item><para/>
        ///     <bullet_item>Unchecked—In junctions with 3 or more waterways, features that are longer will be kept. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果选中，水道分支之间的角度将用于帮助确定主要水道;将使用最高角度。如果不选中，最长的分支将被视为主水道的一部分。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 在具有 3 个或更多水道的交汇点中，将保留角度更接近的要素。</bullet_item><para/>
        ///     <bullet_item>未选中 - 在具有 3 个或更多水道的交汇点中，将保留较长的要素。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Use intersection angles to determine main waterway")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _use_angles_value _use_angles { get; set; } = _use_angles_value._false;

        public enum _use_angles_value
        {
            /// <summary>
            /// <para>USE_ANGLES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("USE_ANGLES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_USE_ANGLES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_USE_ANGLES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _updated_features { get; set; }


        public ThinHydrologyLines SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}